Installing Server Core is only part of the
installation process. When you start Server Core the first time, you'll
need to perform some configuration that you might not have had to
perform in the past. The first step is getting logged in. You'll see
the Press Ctrl+Alt+Del to Log On message as usual. However, after you
press Ctrl+Alt+Del, all you'll see is an entry for Other User—leaving
you to wonder where the Administrator account is. Click Other User and
type Administrator in the User Name field (do not include a password).
Click the Right Arrow icon. It's only at this point that Server Core
finally decides to tell you that you must change the administrator
password before you use the account the first time. Click OK and follow
the prompts to change the password. At this point, you finally see the
messages that the setup program normally displays when configuring a
new operating system. At some point, you'll see a command prompt as
shown in Figure 1 and that's it.
No,
your system isn't broken. You won't see a Start menu or any of the
other usual GUI features of Windows. Unlike other versions of Windows,
you perform all configuration tasks at the command prompt. The following steps will help you get started setting up the server.
Type Net User
YourLoginName YourPassword
/Add
and press Enter. This step sets up an account for you. Of course, you won't have
administrator level privileges. I'm assuming that you're not using this
setup on a domain, so you'll need to add your account to the
Administrator group using a LocalGroup. If you're working on a domain,
then you'll need to add your account to the Administrator group using a
Group instead.
Type Net LocalGroup "Administrators"
YourLoginName
/Add
and press Enter. You now are part of the Administrator group and can
log in under your own name to the system. More importantly, you've just
gained the ability to access the server remotely using Remote Desktop
without having to perform a significant amount of configuration. You'll
want to know what to call the computer, so you need to change the name
of it next.
Type WMIC ComputerSystem Where Name="%COMPUTERNAME%"
Call Rename
Name="NewName"
and press Enter. Make sure you choose a name that will work with your
workgroup or domain setup. Of course, the computer isn't part of the
workgroup or domain yet, so that's what you need to do next.
Type WMIC ComputerSystem Where Name="%COMPUTERNAME%" Call JoinDomainOrWorkgroup
Name="NameOfWorkgroup"
and press Enter. At this point, you have an account on the system and
you're part of the Administrator group. Your computer has an
easy-to-type name that you know and it's part of your workgroup. At
this point, you need to set it up for remote access.
Type WMIC RDToggle Where ServerName="%COMPUTERNAME%" Call SetAllowTSConnections AllowTSConnections="1"
and press Enter. After you reboot the system, it provides Remote
Desktop capability. However, the firewall prevents you from making a
connection, so you need to open a port for the Remote Desktop.
Type NetSH Firewall Set PortOpening TCP 3389 "Remote Desktop" and press Enter. The firewall now permits you access to the server.
It's important for some tasks to have access to the C drive as well, so
you need to create a share. The default share automatically provides
the required permissions.
Type Net Share "Drive_C"=C:\ /Grant:Everyone, Full
and press Enter. Everyone now has access to the C drive. You can refine
the permissions later. However, now you have the required account,
permissions, computer name, workgroup, remote access, and drive access.
Many of the commands you'll work with in this book are actually
scripts. The default scripting engine is WScript—Microsoft uses the
graphical engine for compatibility purposes, but the graphical engine
doesn't work very well in a command line environment. The next step
changes the default scripting engine to the command line equivalent.
NOTE
In
most cases, even if the Server Core partition isn't the first partition
on the drive, it will appear as the C drive when you boot it. Server
Core reconfigures the drive designations as needed to make Server Core
the C drive in most cases. As with anything Microsoft, you'll find
exceptions to this rule, but be sure you know which drive Server Core
actually uses when you boot it before you start issuing any commands.
Type CScript //H:CScript
and press Enter. You'll see a message telling you that the default scripting engine is
now CScript. You should activate your copy of Server Core using the
next step. However, you can skip this step and go right to step 10 if
you prefer.
Type SLMGR -ATO
and press Enter. The activation process seems to take forever. However,
get a cup of coffee, and when you get back, you should see a
confirmation message like the one shown in Figure 2.
(When using WScript instead of CScript, you'll see a confirmation
dialog box that you'll need to dismiss by clicking OK.) It's time to
reboot the system to ensure all of the changes occur.
Type Shutdown /r and press Enter. You'll see a message telling you that the system will shut down in a
few seconds. The system will reboot and you'll find all of the changes
you've made in place. You should also be able to access the system
using Remote Desktop at this point.
NOTE
Sometimes the WMIC RDToggle command won't work properly with older clients. In this case, type SCRegEdit /CS 0
and press Enter. You'll see a message that the script has changed the
proper registry entry. You must reboot the system after making this
change using the Shutdown /r command.
It's
important to note that Server Core won't let you log into the host
machine and into Remote Desktop at the same time. If you plan to use
Remote Desktop, don't log into Server at the host machine. You may also
notice some operational differences when working at the Remote Desktop
and you'll see a slight pause when Remote Desktop obtains updates from
the server. All of these issues are normal and you don't need to worry
about them.
NOTE
This
book assumes that you're using Remote Desktop to perform all tasks, so
your screen-shots may appear slightly different from the ones shown in
the book. In addition, this book assumes that you'll use CScript to
execute scripts. The script output may appear different from the output
shown in the book when you use WScript.
You
may wonder how to change share permissions at the command line.
Apparently, Microsoft overlooked this need as part of the default
configuration. You need to download a tool called RmtShare from http://www.petri.co.il/download_free_reskit_tools.htm to accomplish the task. This utility makes it possible to manage share information on a local or remote drive.
Whenever
you use RmtShare, you must provide the name of the server at a minimum
and a share name as well, in many instances, using the standard
Universal Naming Convention (UNC) format. For example, if you want to
determine the shares on a particular system, you'd type RmtShare \\ServerName and press Enter. The output shows all of the share names, associated resources, and comments for the specified server.
Of
course, you won't simply want to view the shares on a system; you'll
want to modify them in many cases. You can use RmtShare to perform any
required task. The following list describes each of the RmtShare
command line switches.
/USERS: number
Specifies the number of users that can use the share at once. In some
cases, you need to limit the number of users to reduce the load on the
server. Typing RmtShare \\MainXP\Drive_D /USERS:5
and pressing Enter would limit the number of users using the Drive_D
share on MainXP to 5. You can't use this command line switch with the /UNLIMITED command line switch.
/UNLIMITED
Allows an unlimited number of users to access a share at once. To use
this command line switch to change the Drive_D share on MainXP to
unlimited, you'd type RmtShare \\MainXP\ Drive_D /UNLIMITED and press Enter. You can't use this command line switch with the /USERS command line switch.
/REMARK:"text"
Adds a comment to the specified share. For example, if you wanted to
add a comment of "This is Drive D" to the Drive_D share on MainXP,
you'd type RmtShare \\MainXP\ Drive_D /REMARK:"This is Drive D" and press Enter.
/GRANT [user[:{READ | CHANGE | FULL}]]
Allows a user or group to perform specific tasks using the share. For
example, if you wanted to allow a user named George full control of the
Drive_D share on MainXP, you'd type RmtShare \\MainXP\Drive_D /GRANT George:FULL and press Enter.
/REMOVE
user
Denies a user or group the right to use a particular share. For
example, if you wanted to remove the rights of a user named George from
the Drive_D share on MainXP, you'd type RmtShare \\MainXP\Drive_D /REMOVE George and press Enter.
/DELETE Removes an existing share. For example, if you wanted to stop using the Drive_D share on MainXP, you'd type RmtShare \\MainXP\Drive_D /DELETE and press Enter.